package com.gxa.controller.monthgoals;


import com.gxa.common.R;
import com.gxa.pojo.Monthly_Goals_Son;
import com.gxa.pojo.Monthly_Goals_Template;
import com.gxa.pojo.goalPojo.GoalPojo;
import com.gxa.utils.DateUtils;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/edit_goal")
@Api(value = "月度目标编写",tags = "月度目标编写接口")
public class EditMonthGoal {
    @RequestMapping(value = "/queryGoal",method = RequestMethod.GET)
    @ApiOperation(value = "查询月度目标接口",notes = "传递表头信息",httpMethod = "GET", response = GoalPojo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "month_goals",value = "表头信息",required = true,paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R findTiltle(Monthly_Goals_Son mgs){
        R r=new R();
        List<GoalPojo> list=new ArrayList<>();
        GoalPojo goalPojo=new GoalPojo();
        goalPojo.setGoal_Thead1("目标一");
        goalPojo.setGoal_Thead2("目标二");
        goalPojo.setGoal_Thead3("目标三");
        goalPojo.setGoal_Thead4("目标四");
        goalPojo.setGoal_Thead5("目标五");
        goalPojo.setGoal_Thead6("目标六");
        goalPojo.setEmp_name("管理员");
        goalPojo.setTitle("nihao");
        goalPojo.setEntry_Date(DateUtils.getCurrentDate());
        list.add(goalPojo);
        r.setCode(200);
        r.setMsg("success");
        r.setData(list);
        return null;
    }

    @RequestMapping(value = "/updateGoal",method = RequestMethod.GET)
    @ApiOperation(value = "添加月度目标接口",notes = "传递表头信息",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "month_goals",value = "表头信息",required = true,paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R editGoals(Monthly_Goals_Son mgs,Monthly_Goals_Template mgt_tiltle){
        R r=new R();
        r.setCode(200);
        r.setMsg("保存成功");
        r.setData(null);
        return r;
    }
}
